﻿/**
 * 
 * @file FITKAcousticsDiscModel.h
 * @brief 声学离散模型
 * @author LiBaojun (libaojunqd@foxmail.com)
 * @date 2024-10-06
 * 
 */
#ifndef _FITKDISCACOUSTICS_MODEL__H___
#define _FITKDISCACOUSTICS_MODEL__H___
 
#include "FITKAcousticsModelAPI.h"
#include "FITK_Kernel/FITKCore/FITKAbstractDataObject.h"

namespace Acoustics
{
    class FITKAcousticsSEAModel;
    class FITKAcousticsFEModel;
    class FITKAcousticsDiscNodeList;
    class FITKJunctionManager;
    /**
     * @brief 声学离散模型
     * @author LiBaojun (libaojunqd@foxmail.com)
     * @date 2024-10-06
     */
    class FITKAcousticsModelAPI FITKAcousticsDiscModel : public Core::FITKAbstractDataObject
    {
        FITKCLASS(Acoustics, FITKAcousticsDiscModel);
    public:
        /**
         * @brief Construct a new FITKAcousticsDiscModel object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-06
         */
        explicit FITKAcousticsDiscModel();
        /**
         * @brief Destroy the FITKAcousticsDiscModel object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-06
         */
        virtual ~FITKAcousticsDiscModel();
        /**
         * @brief 从AppFrame获取对象
         * @return FITKAcousticsDiscModel* 
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-06
         */
        static FITKAcousticsDiscModel* GetDiscModelFromFrame();
        /**
         * @brief    获取节点列表
         * @return   FITKAcousticsDiscNodeList *
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-12
         */
        FITKAcousticsDiscNodeList* getNodes();
        /**
         * @brief 获取SEA模型
         * @return FITKAcousticsSEAModel* 
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-06
         */
        FITKAcousticsSEAModel* getSEAModel();
        /**
         * @brief 获取FE模型
         * @return FITKAcousticsFEModel* 
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-06
         */
        FITKAcousticsFEModel* getFEModel();
        /**
         * @brief    获取交界处耦合管理器
         * @return   FITKJunctionManager *
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-21
         */
        FITKJunctionManager* getJunctionManager();
        /**
         * @brief    获取全部未使用的节点ID
         * @return   QList<int>
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-12
         */
        QList<int> getUnUsedNodeIDs();
        /**
         * @brief    获取全部使用到的节点ID
         * @return   QList<int>
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-12-12
         */
        QList<int> getUsedNodeIDs();
        /**
         * @brief  获取自由边
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-12-12
         */
        QList<QPair<int, int>> getFreeEdge();
        /**
         * @brief    更新FE所有节点映射，并将FE节点拷贝一份到离散模型
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-18
         */
        void updataFENodesMap();
        /**
         * @brief    清理离散模型
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-11-21
         */
        void clearDiscModel();

    private:
        QList<QPair<int, int>> getSEASubSysFreeEdge();
        QList<QPair<int, int>> getFESubSysFreeEdge();

    private:
        /**
         * @brief  节点链表
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2024-12-12
         */
        FITKAcousticsDiscNodeList* _nodeList{};
        /**
         * @brief SEA模型
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-06
         */
        FITKAcousticsSEAModel* _seaModel{};
        /**
         * @brief FE模型
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-06
         */
        FITKAcousticsFEModel* _feModel{};
        /**
         * @brief  junction管理器
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date   2025-01-21
         */
        FITKJunctionManager* _junctionManager{};
 
    private:
        static  FITKAcousticsDiscModel* _DsicModel;

    };
}


#endif
